<?php

namespace App\Providers;

use App\Facades\Site;
use App\Repositories\Eloquent\AliyunSms;
use Illuminate\Support\ServiceProvider;
use App\Repositories\Eloquent\AlidayuSms;

class SmsServiceProvider extends ServiceProvider {
    public function boot () {
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register () {
        $this->app->singleton('Sms', function () {
            $smsType = Site::get('SmsType');
            if($smsType == '2'){
                return new AliyunSms();//返回阿里云短信
            }else{
                return new AlidayuSms();//返回阿里大鱼短信
            }
        });

    }
}
